import requests from '@/utils/request'

// 导出获取部门列表函数
export const getDepartmentAPI = () => {
  return requests({ url: '/company/department' })
}

// 导出获取负责人列表
export const getPrincipalListAPI = (params) => {
  return requests({ url: '/sys/user/simple' })
}

// 导出新增部门请求
export const addDepartmentAPI = (data) => {
  return requests({ url: '/company/department', method: 'post', data })
}

// 导出获取部门详细
export const getDepartmentDetailsAPI = (id) => {
  return requests({ url: `/company/department/${id}` })
}

// 导出修改部门详细请求
export const upDateDepAPI = (data) => {
  return requests({ url: `/company/department/${data.id}`, method: 'put', data })
}

// 导出删除部门请求
export const delDepAPI = (id) => {
  return requests({ url: `/company/department/${id}`, method: 'delete' })
}
